

<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/UserWork/userWork?params=1" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="userWork" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <label>作业员工号：</label>
            <input type="text" name="user" value="${user}"/>
            <label>作业员姓名：</label>
            <input type="text" name="userName" value="${userName}"/>
            <label>部门：</label>
            <input type="text" name="department" value="${department}"/>
            <label>批次：</label>
            <input type="text" name="lotId" value="${lotId}"/>
            <label>工序编码：</label>
            <input type="text" name="stepName" value="${stepName}"/>
            <label>工序名称：</label>
            <input type="text" name="stepDesc" value="${stepDesc}"/>
            <label>存货编码：</label>
            <input type="text" name="partName" value="${partName}"/>
            <label>产品图号：</label>
            <input type="text" name="group3" value="${group3}"/>
            <label>加工设备：</label>
            <input type="text" name="eqp" value="${eqp}"/>
            %{--<label>批次：</label>
            <g:select name="lotId" from="${userWorkLotList}" data-toggle="selectpicker" data-live-search="true" optionKey="lot_id" optionValue="lot_id" value="${lotId}" noSelection="['': '===ALL===']"/>&nbsp;
            <label>作业员：</label>
            <g:select name="user" from="${userWorkUserList}" data-toggle="selectpicker" data-live-search="true" optionKey="work_user" optionValue="work_user" value="${user}" noSelection="['': '===ALL===']"/>&nbsp;
            <label>工序：</label>
            <g:select name="step" from="${userWorkStepList}" data-toggle="selectpicker" data-live-search="true" optionKey="step" optionValue="step" value="${step}" noSelection="['': '===ALL===']"/>&nbsp;
            <label>物料编码：</label>
            <g:select name="partName" from="${userWorkPartNameList}" data-toggle="selectpicker" data-live-search="true" optionKey="part_name" optionValue="part_name" value="${partName}" noSelection="['': '===ALL===']"/>&nbsp;

            <label>产品图号：</label>
            <g:select name="group3" from="${userWorkGroupList}" data-toggle="selectpicker" data-live-search="true" optionKey="group3" optionValue="group3" value="${group3}" noSelection="['': '===ALL===']"/>&nbsp;
            <label>加工设备：</label>
            <g:select name="eqp" from="${userWorkEqpList}" data-toggle="selectpicker" data-live-search="true" optionKey="jiagong_eqp" optionValue="jiagong_eqp" value="${eqp}" noSelection="['': '===ALL===']"/>&nbsp;--}%

            <label >时间：</label>&nbsp;
            <input type="text" name="startTime" readonly value="${startTime}" data-rule="required" data-toggle="datepicker" placeholder="FROM">
            <input type="text" name="endTime" readonly value="${endTime}" data-rule="required" data-toggle="datepicker" placeholder="TO">&nbsp;&nbsp;

            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/BadProcessAnalysis/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="bjui-pageContent">
    <g:if test="${userWork.size() > 0}">
        <table id="lapEndByBatch" data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr id="t1">
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance!='RN'}">
                        <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:if test="${userWork.size()>0}">
                <g:each in="${userWork}" status="i" var="dataInstance">
                    <tr>
                        <g:each in="${tableHeadList}" status="j" var="headInstance">
                            <g:if test="${headInstance=='MAIN_QTY'}">
                                <td name="USERWORKQTY${i}">${dataInstance["${headInstance}"] }</td>
                            </g:if>
                            <g:elseif test="${headInstance!='RN'}">
                                <td>${dataInstance["${headInstance}"] }</td>
                            </g:elseif>
                        </g:each>
                    </tr>
                </g:each>
                <tr>
                    <td colspan="12">小计</td>
                    <td name="userWorkShow"></td>
                </tr>
                <tr>
                    <td colspan="12">合计</td>
                    <td>${userWorkSumQty.SUM_QTY[0]}</td>
                </tr>

            </g:if>
            <g:else>
                <g:render template="../template/emptyPanel" />
            </g:else>
            </tbody>
        </table>
    </g:if>
</div>
<g:render template="../template/pagination" />
<script>
    $(function(){
        var userWorkQty=0;
        for(var i=0;i<${userWork.size()};i++){
            var userworkqty='USERWORKQTY'+i
            var userWorkAdd=$("td[name='"+userworkqty+"']").text()==''?0:parseInt($("td[name='"+userworkqty+"']").text())
            userWorkQty+=userWorkAdd
        }
        $("td[name='userWorkShow']").html(userWorkQty)

    })
</script>